package github.ziwukun.jsonql.orm;

import java.util.ArrayList;
import java.util.List;

/**
 * 容器字段实现
 * @author Hugo.Yu
 */
class CtnFieldImpl implements CtnField{
	String fieldName;
	List<CtnFieldImpl> childFields = new ArrayList<>();
	
	CtnFieldImpl(CtnPropBuilder ctnPropBuilder){
		CtnPropBuilder.instanceCtnField(ctnPropBuilder, this);
	}
	CtnFieldImpl(String fieldName){
		this.fieldName = fieldName;
	}
	
	
	@Override
	public String fieldName() {
		return fieldName;
	}

	@Override
	public List<CtnField> childFields() {
		return new ArrayList<>(childFields);
	}
	
}
